A Method for Distributing Voice Channels and a Voice System

ABSTRACT

Provided is a method for distributing voice channels, including: randomly selecting a preset quantity of voice servers at a preset time interval, and distributing at least one token to each of the voice servers selected herein; and said voice servers receiving said tokens, and when receiving uplink voice by any of the voice servers carrying at least one token, the voice server carrying the token processing said uplink voice as a priority. In this way, the channel is preempted by the uplink voice through the token, so that users corresponding to every voice servers have equal probability of acquiring channels; and voice servers will not suffer from channels taken up for a long time due to data being forwarded by other voice servers, thereby saving resources of voice channels. Also provided is a voice system.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of PCT Patent ApplicationNo. PCT/CN2014/073437, entitled “A method for Distributing VoiceChannels and a Voice System”, filed on Mar. 14, 2014, which claimspriority to Chinese Application No. 201310228304.9, “A METHOD FORDISTRIBUTING VOICE CHANNELS AND A VOICE SYSTEM”, filed on Jun. 8, 2013,both of which are hereby incorporated by reference in their entirety.

TECHNICAL FIELD

The present disclosure relates to the field of computer technology, andmore particularly to a method for distributing voice channels, and avoice system.

BACKGROUND

According to the prior art method for distributing voice channels, sincea voice server cannot recognize whether a voice applicant is authorized,each of voice servers needs a centralized processing through a unifiedserver; and before acquiring the processing result from the unifiedserver, the voice server needs to reserve resources of voice channels.When the voice server receives a large amount of voice applications, alot of waste of resources will be caused.

SUMMARY

In view of the defects mentioned above, in one aspect, the presentdisclosure provides a method for distributing voice channels, which iscapable of saving resources of voice channels.

A method for distributing voice channels includes following steps:

randomly selecting a preset quantity of voice servers at a preset timeinterval, and distributing at least one token to each of the voiceservers selected herein; and

receiving said tokens by said voice servers, and when any of the voiceservers carrying at least one token receives uplink voice, processingsaid uplink voice as a priority by the voice server receiving the uplinkvoice.

In another aspect, the present disclosure provides a voice system whichis capable of saving resources of voice channels.

The voice system includes:

a room server, configured to randomly select a preset quantity of voiceservers at a preset time interval, and distribute at least one token toeach of the voice servers selected herein; and the voice servers,configured to receive said tokens, and when any of voice serverscarrying at least token receives uplink voice, the voice serverreceiving the uplink voice processes said uplink voice as a priority.

According to the method for distributing voice channels and the voicesystem mentioned above, a preset quantity of voice servers are randomlyselected at a preset time interval, and at least one token isdistributed to each of the voice servers selected herein; and when anyof the voice servers carrying at least one token receives uplink voice,the voice server receiving the uplink voice processes said uplink voiceas a priority. In this way, the voice servers do not need a centralizedprocessing through the unified server, but users corresponding to everyvoice server have equal probability of acquiring channels; and voiceservers will not suffer from channels taken up for a long time due todata being forwarded by other voice servers, thereby saving resources ofvoice channels.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flow diagram illustrating the method for distributing voicechannels according to one embodiment of the present invention;

FIG. 2 is structure diagram illustrating the voice system according toone embodiment of the present invention.

DETAILED DESCRIPTION OF DISCLOSED EMBODIMENTS

In order to make the purpose, technical solutions and advantages of thepresent disclosure to be understood more clearly, the present disclosurewill be described in further details with the accompanying drawings andthe following embodiments. It should be understood that the specificembodiments described herein are merely examples to illustrate theinvention, not to limit the present disclosure.

In one embodiment as shown in FIG. 1, a method for distributing voicechannels is provided, comprising:

Step 102, randomly selecting a preset quantity of voice servers at apreset time interval, and distributing at least one token to each of thevoice servers selected herein.

In this embodiment, the method for distributing voice channels isapplied to a voice system containing multiple room servers and multiplevoice servers. Wherein, the room server is a server configured to handlethe allocation of centralized resources of a room; one room server isdesignated to one room, and said room server is configured to allocatemultiple voice servers to the room, so that, when one of the voiceservers receives uplink voice, the uplink voice will be broadcasted,i.e., the uplink voice will be sent to other voice servers, so that, thespeech made by the user in the present channel can be heard by otherusers. Particularly, the room server can randomly select a presetquantity of voice servers at a preset time interval, and distribute atleast one token to each of the voice servers selected herein. Each tokencorresponds to one logic voice channel, i.e., each voice server can beprovided with one or more voice channels. Preferably, the preset timeinterval may be five seconds, the preset quantity may be four, that isto say, there are maximum four voice channels in one room, which meansthere are maximum four persons permitted to speak simultaneously.

In this embodiment, the room server adopts a pure random algorithm torandomly select voice servers, wherein, the token is a data label,having selected voice servers, the room server distributes the datalabels to said voice servers selected herein.

Step 104, receiving said tokens by said voice servers, and when any ofthe voice servers carrying at least one token receives uplink voice,processing said uplink voice as a priority by the voice server receivingthe uplink voice.

In this embodiment, with regard to the voice server carrying the token,when receiving uplink voice, said voice server will process said uplinkvoice as a priority, which means the voice server will process the voicedata uplinked by a terminal as a priority, and broadcast the receivedvoice data to other voice servers.

In this embodiment, since the room server randomly selects voice serversand distributes tokens, and when receiving uplink voice, said voiceserver carrying the token will process said uplink voice as a priority.In this way, the channel is preempted by the uplink voice through thetoken, so that users corresponding to every voice server have equalprobability of acquiring channels; and voice servers will not sufferfrom channels taken up for a long time due to data being forwarded byother voice servers, thereby saving resources of voice channels.

In the step 104 according to one embodiment, the step of processing saiduplink voice as a priority includes: said voice server receives saiduplink voice and broadcast said uplink voice; and the voice databroadcasted carries the token of said voice server. That is to say, whenreceiving the uplink voice, the voice server carrying the token,broadcasts the uplink voice directly to other voice servers, and thevoice data broadcasted herein carries the token of said voice server. Inthis embodiment, the voice server broadcasts the uplink voice to othervoice servers in order that the speech made by the user in the presentchannel can be heard by other users.

In the step 104 according to one embodiment, the step of processing saiduplink voice as a priority includes: said voice server receives thehighest priority uplink voice and broadcasts said uplink voice; and saiduplink voice data broadcasted herein carries the token carried by saidvoice server. In this embodiment, multiple levels of priority of thevoice data uplinked by multiple terminals, which are connected to thevoice servers, can be set. For example, if a user in the currentterminal is making a speech, the priority of said speech is higher thanthe voice data uplinked by other terminals, and the uplink voicecorresponding to said speech will be broadcasted to other voice serversas a priority.

Furthermore, in one embodiment, the method for distributing voicechannels comprises: said voice server receives said voice databroadcasted herein; and down-links voice data carrying the token, ofsaid voice data received herein, to a terminal. In this embodiment,having received the broadcasted voice data, the voice server onlydown-links the voice data carrying the tokens to the terminal which isconnected to said voice server, thereby ensuring the uniformity of thevoice received by other users in the same room.

Furthermore, in one embodiment, said token contains a timestamprecording distributing time of said token; and the process ofdown-linking the voice data carrying the token, of said voice datareceived herein, to a terminal comprises: detecting whether saidtimestamp of said token carried by the voice data received herein, isnewer than a timestamp of a token received currently by said voiceserver; and if said timestamp of said token carried by the voice datareceived herein is newer than said timestamp of said token receivedcurrently by said voice server, said voice data carrying the token isdown-linked to a terminal; and said token carried by said voice data isthe token carried by the voice sever broadcasting said voice data.

In this embodiment, the room server distributes tokens to voice serversselected randomly, and the distributed token contains a timestamp whichrecorded the distributing time of said token. Since the room serverdistributes tokens through network transmission, if there is messagedelay, the receiving time of tokens by different voice servers will beout of sync. If the voice server detects that the timestamp of saidtoken carried by the voice data received herein is earlier than saidtimestamp of said token received currently by said voice server, itindicates that the received voice data has expired; said token carriedby said voice data is deemed invalid, and said voice data carrying thetoken will not be down-linked to the terminal. If the voice serverdetects that the timestamp of said token carried by the voice datareceived herein is later than said timestamp of said token receivedcurrently by said voice server, it indicates that the received voicedata is the latest, and then said voice data carrying the token will bedown-linked to the terminal. In this embodiment, the expired token data(voice data carrying the token) is prevented from being forwarded by thetimestamp effectively, thereby improving the accuracy of distributingvoice channels.

A preferred embodiment will be described as follows to illustrate theprinciple of the method for distributing voice channels mentioned above.In this embodiment, the method for distributing voice channels isapplied to a distributed voice system containing multiple room serversand multiple voice servers. To simplify the illustration, a voice systemcontaining one room server and multiple voice servers is taken as anexample. Said room server is designated to one room, and said roomserver is configured to allocate multiple voice servers to this room.Particularly, the room server randomly selects four voice servers everyfive seconds, and distributes one token for each of selected voiceservers, which means there are maximum four users permitted to speaksimultaneously. In another embodiment, more than one tokens can bedistributed to any one of the selected voice servers. In the selectedvoice servers, each voice server connects at least one user terminal,when receiving uplink voice, the voice server carrying the tokenprocesses said uplink voice (that is, the speech (voice data) made bysaid user corresponding to the user terminal connected to the voiceserver) as a priority, and broadcasts the uplink voice received to othervoice servers in the same room. In this way, users in the same room canhear the speech made by said user. The broadcasted voice data carriesthe token of said voice server. Furthermore, having received thebroadcasted voice data, other voice servers only down-link the voicedata carrying the token to the user terminals which are connected tosaid voice servers, thereby ensuring the uniformity of the voicereceived by other users in the same room.

In one embodiment as shown in FIG. 2, a voice system is provided,comprising: a room server 202 and voice servers 204. It should beunderstood that, the voice system provided in the present disclosure isa distributed voice system containing multiple room servers and multiplevoice servers. The voice system containing one room server and multiplevoice servers in this embodiment is only given as an example forillustration.

Wherein, the room server 202 is configured to randomly select a presetquantity of voice servers 204 at a preset time interval, and distributea token to each of the selected voice servers 204.

In this embodiment, the room server 202 adopts a pure random algorithmto randomly select voice servers, wherein, the token is a data label,having selected voice servers 204, the room server 202 distributes thedata labels to the voice servers 204 herein. Preferably, the preset timeinterval may be five seconds and the preset quantity of the voiceservers may be four, and one token is distributed to each voice server,that is to say, there are maximum four voice channels in one room, whichmeans there are maximum four persons permitted to speak simultaneously.

The voice server 204 is configured to receive a token, and, whenreceiving uplink voice, the voice server 204 carrying the tokenprocesses said uplink voice as a priority.

In this embodiment, with regard to the voice server 204 carrying thetoken, when receiving the uplink voice, said voice server 204 processessaid uplink voice as a priority, which means that the voice server 204processes voice data uplinked by a terminal as a priority, andbroadcasts the received voice data to other voice servers.

In this embodiment, since the room server 202 randomly selects voiceservers 204 and distributes tokens, and, when receiving uplink voice,said voice server 204 carrying the token processes said uplink voice asa priority, that is, the channel is preempted by the uplink voicethrough the token, so that users corresponding to every voice server 204have equal probability of acquiring channels; and voice servers 204 willnot suffer from channels taken up for a long time due to data beingforwarded by other voice servers, thereby saving resources of voicechannels.

In one embodiment, the voice server 204 is configured to receive theuplink voice and broadcast said uplink voice; and the broadcasted voicedata contains the token of the voice server 204 broadcasting said voicedata. In this embodiment, the voice server 204 broadcasts the uplinkvoice to other voice servers in order that the speech made by the userin the present channel can be heard by other users.

In one embodiment, the voice server 204 is configured to receive thehighest priority uplink voice and broadcast the uplink voice received;and the broadcasted voice data contains the token of the voice server204. In this embodiment, multiple levels of priority of the voice datauplinked by multiple terminals, which are connected to the voice server204, can be preset in advance, for example, if a user in the currentterminal is making a speech, the priority of said speech is higher thanthe voice data uplinked by other terminals.

Furthermore, in one embodiment, the voice server 204 is configured toreceive the broadcasted voice data; and down-link the voice datacarrying the token, of the voice data received herein, to a terminal. Inthis embodiment, having received the broadcasted voice data, the voiceserver only down-links the voice data carrying the token to theterminal, thereby ensuring the uniformity of the voice received by otherusers in the same room.

Furthermore, in one embodiment, the token contains a timestamp recordingdistributing time of said token; and the voice server 204 is furtherconfigured to detect whether said timestamp of said token carried by thevoice data received herein, is newer than the timestamp of the tokenreceived currently by said voice server 204; and if said timestamp ofsaid token carried by the voice data received herein is newer than saidtimestamp of said token received currently by said voice server 204,then the voice server down-links said voice data carrying the token to aterminal; and said token carried by said voice data is the token carriedby the voice sever broadcasting said voice data.

In this embodiment, the room server 202 distributes tokens to voiceservers 204 selected randomly, and the distributed token contains atimestamp which recorded the distributing time of said token. Since theroom server 202 distributes tokens through network transmission, ifthere is message delay, the receiving time of tokens by different voiceservers 204 will be out of sync. If the voice server 204 detects thatthe timestamp of said token carried by the voice data received herein isearlier than said timestamp of said token received currently by saidvoice server 204, it indicates that the received voice data has expired;said token carried by said voice data is deemed invalid, and said voicedata carrying the token will not be down-linked to the terminal. If thevoice server 204 detects that the timestamp of said token carried by thevoice data received herein is later than said timestamp of said tokenreceived currently by said voice server 204, it indicates that thereceived voice data is the latest, and then said voice data carrying thetoken will be down-linked to the terminal. In this embodiment, theexpired token data (voice data carrying the token) is prevented frombeing forwarded by the timestamp effectively, thereby improving theaccuracy of distributing voice channels.

It should be understood by those skilled in the art that all or part ofthe processes of preferred embodiments disclosed above may be realizedthrough relevant hardware commanded by computer program instructions.Said program may be saved in a computer readable storage medium, andsaid program may include the processes of the preferred embodimentsmentioned above when it is executed. Wherein, said storage medium may bea diskette, optical disk, ROM (Read-Only Memory) or RAM (Random AccessMemory), and so on.

It should be understood by those skilled in the art that what describedabove are preferred embodiments of the present disclosure. Variousmodifications and replacements may be made therein without departingfrom the theory of the present disclosure, which should also be seen inthe scope of the present disclosure.

What is claimed is:
 1. A method for distributing voice channels,comprising following steps: randomly selecting a preset quantity ofvoice servers at a preset time interval, and distributing at least onetoken to each of the voice servers selected herein; and receiving saidtokens by said voice servers, and when any of the voice servers carryingat least one token receives uplink voice, processing said uplink voiceas a priority by the voice server receiving the uplink voice.
 2. Themethod for distributing voice channels according to claim 1, wherein,said step of processing said uplink voice as a priority by the voiceserver receiving the uplink voice comprises following step: receivingand broadcasting said uplink voice; and wherein voice data of saiduplink voice broadcasted herein carries a token carried by said voiceserver receiving the uplink voice.
 3. The method for distributing voicechannels according to claim 2, further comprising following steps:receiving, by voice servers other than said voice server receivinguplink voice. said voice data broadcasted herein; and down-linking voicedata carrying the token to a terminal.
 4. The method for distributingvoice channels according to claim 3, wherein, said token contains atimestamp recording distributing time of said token; and said step ofdown-linking voice data carrying the token to a terminal comprisesfollowing steps: detecting, by voice servers other than said voiceserver receiving uplink voice. whether said timestamp of said token,contained in the voice data received herein, is newer than a timestampof a token received currently by said voice servers other than saidvoice server receiving uplink voice; and if said timestamp of said tokencarried by the voice data received herein is newer than said timestampof said token received currently by said voice servers other than saidvoice server receiving uplink voice, said voice data carrying the tokenis down-linked to a terminal; and said token carried by said voice datais the token carried by the voice sever broadcasting said voice data. 5.The method for distributing voice channels according to claim 1,wherein, said step of processing said uplink voice as a priority by thevoice server receiving the uplink voice comprises the following step:receiving the highest priority uplink voice and broadcasting said uplinkvoice; and wherein said voice data broadcasted herein carries a tokencarried by said voice server receiving the uplink voice.
 6. A voicesystem, comprising: a room server, configured to randomly select apreset quantity of voice servers at a preset time interval, anddistribute at least one token to each of the voice servers selectedherein; and the voice servers, configured to receive said tokens, andwhen any of voice servers carrying at least token receives uplink voice,the voice server receiving the uplink voice processes said uplink voiceas a priority.
 7. The voice system according to claim 6, wherein, voiceservers other than said voice server receiving the uplink voice receiveand broadcast said uplink voice; and voice data of said uplink voicebroadcasted herein carries a token carried by said voice serverreceiving the uplink voice.
 8. The voice system according to claim 7,wherein, voice servers other than said voice server receiving the uplinkvoice receive said voice data broadcasted herein; and down-link voicedata carrying the token, of the voice data received herein, to aterminal.
 9. The voice system according to claim 8, wherein, said tokencontains a timestamp recording distributing time of said token; and saidvoice servers other than said voice server receiving the uplink voiceare configured to detect whether said timestamp of said token, containedin the voice data received herein, is newer than a timestamp of a tokenreceived currently by said voice servers other than said voice serverreceiving the uplink voice; and if said timestamp of said token carriedby the voice data received herein is newer than said timestamp of saidtoken received currently by said voice servers other than said voiceserver receiving the uplink voice, said voice data carrying the token isdown-linked to a terminal; and said token carried by said voice data isthe token carried by the voice sever broadcasting said voice data. 10.The voice system according to claim 6, wherein, said voice serverreceiving the uplink voice receives the highest priority uplink voiceand broadcasts said uplink voice; and said voice data broadcasted hereincarries the token carried by said voice server receiving the uplinkvoice.